package com.yjd.pub.user.dao.impl;

import com.yjd.comm.user.dto.UserSession;
import org.springframework.stereotype.Component;
import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.user.model.UserModel;
import com.yjd.pub.user.dao.IUserDao;

import java.util.Map;

/**
 * <b>description</b>：用户数据访问层 <br>
 * <b>time</b>：2017-06-27 08:58:59 <br>
 * <b>author</b>： yangchangyan@yijiedai.com
 */
@Component("userDao")
public class UserDaoImpl extends BaseDaoImpl implements IUserDao {

	private static final String SQLMAPNAMESPACE = UserModel.class.getName();
	private static final String PKNAME = "user_id";

	/**
	 * 获取用户信息
	 *
	 * @param paramMap
	 * @return UserSession
	 */
	@Override
	public UserSession getUserSession(Map<String, Object> paramMap) {
		return (UserSession) this.getSqlMap().queryForObject(
				getNamesapceToSqlmapPrefix() + "getSessionUser", paramMap);
	}

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}
	
}
